package cn.yunhe.action;

import cn.yunhe.eneity.Emp;
import cn.yunhe.service.impl.EmpService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import lombok.Getter;
import lombok.Setter;

import java.util.List;
import java.util.Map;

@Getter
@Setter
public class EmpAction extends ActionSupport {
    private EmpService empService;

    @Override
    public String execute() throws Exception {
        List<Emp> list = empService.getAllEmps();
        Map request = (Map) ActionContext.getContext().get("request");
        request.put("list", list);
        return SUCCESS;
    }
}
